<template>
    <div class="item">
        <div class="left">
            <img :src="orderInfo.productImg">
        </div>
        <div class="right">
            <div class="goodsInfo">
                <div class="name">{{ orderInfo.productName }}</div>
                <div class="price">单价：￥{{ orderInfo.productPrice }}</div>
                <div class="count">数量：{{ orderInfo.productQty }}</div>
                <div class="amount">小计：￥{{ price }}</div>
            </div>
            <div class="address">
                <i>收货信息：</i>
                <span>{{ orderObj.address }}</span>
                <span>{{ orderObj.name }}</span>
                <span>{{ orderObj.phone }}</span>
            </div>
            <div class="order">
                <span>订单编号：{{ orderObj.orderCode }}</span>

                <span v-if="orderObj.orderStatus === 0">订单状态：待发货</span>
                <span v-else-if="orderObj.orderStatus === 1">订单状态：已发货</span>
                <span v-else-if="orderObj.orderStatus === 2">订单状态：已收货</span>

                <span>下单时间：{{ orderObj.createdDt }}</span>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    name: 'OrderCard',
    components: {

    },
    mixins: [],
    props: ['orderInfo', 'orderObj'],
    data() {
        return {

        }
    },
    computed: {
        price() {
            return (this.orderInfo.productPrice * this.orderInfo.productQty).toFixed(2)
        }
    },
    watch: {

    },
    mounted() {
    },
    methods: {

    }
};
</script>
<style lang='less' scoped>
.item {
    display: flex;
    padding: 20px 0;
    font-size: 13px;
    border-bottom: 2px solid rgb(235, 234, 234);

    .left {
        margin-right: 20px;

        img {
            width: 100px;
            height: 100px;
            border-radius: 10px;
        }
    }

    .right {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;

        .goodsInfo {
            display: flex;

            div {
                flex: 1;
            }
        }

        .address {
            font-size: 12px;
            color: rgb(104, 103, 103);

            span {
                margin-right: 10px;
            }
        }

        .order {
            font-size: 12px;
            color: rgb(104, 103, 103);
            display: flex;
            justify-content: space-between;
            align-items: center;

            span {
                flex: 1;
            }
        }
    }


}
</style>